package _interview150;

/**
 * 55. 跳跃游戏
 */
public class No55 {
    public boolean canJump(int[] nums) {
        int maxIndex = nums[0];
        for (int i = 0; i <= maxIndex; i++) {
            maxIndex = Math.max(i + nums[i], maxIndex);
            if (maxIndex >= nums.length - 1) return true;
        }
        return false;
    }
}
